-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(dh): apollo data source #3517
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 82b4764. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 3 targetsSent with 💌 from NxCloud. |
Test results for \apps\dh\api-dh\source\DataHub.WebApi.Tests\bin\Release\net8.0\Energinet.DataHub.WebApi.Tests.dll1 tests 1 ✅ 2m 42s ⏱️ Results for commit edaa4e6. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Praise: Looks great, not understanding all of it :P
Description
This PR introduces the new ApolloDataSource, which is a Material DataSource implementation that is meant to be used with the new auto-generated DataSource classes. When you add
UsePaging
andUseSorting
to a list query in the BFF (and update the related.graphql
operation file), a corresponding DataSource class will be generated in thegraphql.ts
file. For example, if you were to add paging and sorting to thegridAreas
query, a new class namedGetGridAreasDataSource
will be available ingraphql.ts
. This can be used directly withwatt-table
to get a fully server-side paginated and sort enabled table. The DataSource also enables thefilter
function (search field in the table). Just add a string parameter namedfilter
to the paginated query in the BFF.The PR also implements this new functionality for the calculations table. Since that table is now fully server-side paginated, I had to make some changes to the subscription part. It ended up simplifying the logic quite a bit, with the only caveat that calculations that others create are not automatically added to the list (this might not even be a bad thing). Instead we use
refetchQueries
now when you create a new calculation.References